<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

/*Route::middleware('auth:api')->get('/user', function (Request $request) {
    return $request->user();
});*/
//登陆
Route::post('login', 'AuthController@login');
Route::post('logout', 'AuthController@logout');
Route::post('refresh', 'AuthController@refresh');

Route::post('register', 'AuthController@register');
Route::post('sendVerifyCode','SendMessageController@send');




Route::post("/upload","UploadFileController@upload");//上传文件
Route::post("/upload/ueditor","UploadFileController@uploadUeditor");//上传文件
Route::get("/city","CityController@index"); //城市列表
Route::get("/defaultCity","CityController@defaultCity");//得到默认城市

Route::get("/area","AreaController@index");//面积范围筛选列表
Route::get("/city/{city_id}","CityController@detail");//城市下级区域
Route::get("/workshop/{type}","WorkshopController@index"); //厂区列表 搜索查询
Route::get("/workshopZS/{type}","WorkshopZSController@index"); //厂区列表 搜索查询
Route::get("/workshops/{workshop_id}",'WorkshopController@detail');//厂区详情
Route::get("/news",'NewsController@index');//新闻
Route::get("/newsZs",'NewsController@zsIndex');//新闻
Route::get("/news/{id}",'NewsController@detail');
Route::get("/newsZs/{id}",'NewsController@zsDetail');
Route::get("/about",'AboutController@index');//关于我们
Route::get("/park",'ParkController@index');//园区列表
Route::get('/parkArea','ParkController@area');//园区面积
Route::get("/park/{id}",'ParkController@detail');//园区详情
Route::get("/channel/{id}",'ParkController@channel');//园区频道
Route::get("/website",'WebsiteController@index');//网站信息
Route::get("/land",'LandController@index');//土地列表
Route::get("/landArea",'LandController@area');//土地面积
Route::get("/land/{id}",'LandController@detail');//土地详情
Route::get("/building",'BuildingController@index');//写字楼列表
Route::get("/building/{id}",'BuildingController@detail');//写字楼详情
Route::get('/buildingArea','BuildingController@area');//写字楼面积

Route::get('/records','UserController@records');//写字楼面积
Route::post('/release/{type}','ReleaseController@index');//前台需求添加
//行业接口
Route::get('/industry','IndustryController@index');

//提交表单接口
Route::post('/submit','IndustryController@submit');
//Route::post('/','');
Route::get('/bindCall/{true_mobile}','CallController@bindCall');//电话号绑定
Route::post('/searchCall/{mobile}','CallController@searchCall');//搜索
Route::post('/unbindCall/{true_mobile}/{virtualMobile}','CallController@unbindCall');//电话号绑定


//需要登陆权限的
Route::get('/subscribe','SubscribeController@isSubscribe');//查询关注
Route::group(['middleware' => 'auth:api'], function()
{
    Route::post('/subscribe','SubscribeController@subscribe');//关注
    Route::post('/unSubscribe','SubscribeController@unSubscribe');//取消关注
    Route::get('/subscribeList','SubscribeController@subscribeList');//查询关注
    Route::get('/user',function(Request $request){
        return $request->user('api');
    });
});
//
//telell平台推送
Route::post('/notifyCallUrl','NotifyCallController@notifyCallUrl');
Route::post('/notifyMediaStreamUrl','NotifyCallController@notifyMediaStream');//媒体通知接口


